import request from '@/utils/request'
// import { getToken } from '@/utils/storage'

export const getArticles = params => request.get('/h5/interview/query', { params })

export const getArticleDetail = id => request.get('/h5/interview/show', { params: { id } })

export const updateLike = id => request.post('/h5/interview/opt', { id, optType: 1 })

export const updateCollect = id => request.post('/h5/interview/opt', { id, optType: 2 })

// 获取我的收藏
export const getArticlesCollect = (obj) => {
  return request.get('/h5/interview/opt/list', {
    params: {
      page: obj.page, // 当前页
      pageSize: 5, // 可选
      optType: 2 // 表示收藏
    }
  })
}

// 获取我的点赞
export const getArticlesLike = (obj) => {
  return request.get('/h5/interview/opt/list', {
    params: {
      page: obj.page, // 当前页
      pageSize: 5, // 可选
      optType: 1 // 表示喜欢
    }

  })
}

// 获取用户信息
export const getUserInfo = () => {
  return request('/h5/user/currentUser')
}
